<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>主场篮球</title>
  <link rel="stylesheet" href="../../static/web/layui/css/layui.css" th:href="@{/web/layui/css/layui.css}" />
  <link rel="stylesheet" href="../../static/web/font-awesome/css/font-awesome.min.css" th:href="@{/web/font-awesome/css/font-awesome.min.css}"/>
  <link rel="stylesheet" href="../../static/web/kitadmin/css/app.css" th:href="@{/web/kitadmin/css/app.css}"/>
  <link rel="stylesheet" href="../../static/web/kitadmin/css/themes/default.css" id="skin" kit-skin th:href="@{/web/kitadmin/css/themes/default.css}"/>

  <script src="../../static/web/layui/layui.js" th:src="@{/web/layui/layui.js}"></script>
  <script src="../../static/web/jquery-3.3.1/jquery-3.3.1.js" th:src="@{/web/jquery-3.3.1/jquery-3.3.1.js}"></script>
  <script src="../../static/web/kitadmin/js/common.js" th:src="@{/web/kitadmin/js/common.js}"></script>

</head>

<body class="kit-theme">
<div class="layui-layout layui-layout-admin kit-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">主场篮球</div>
    <div class="layui-logo kit-logo-mobile">K</div>
    <ul class="layui-nav layui-layout-right kit-nav">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <i class="layui-icon layui-icon-theme" ></i> 皮肤
        </a>
        <dl class="layui-nav-child skin">
          <dd><a href="javascript:;" data-skin="default" style="color:#393D49!important;">
            <i class="layui-icon">&#xe658;</i> 默认</a></dd>
          <dd><a href="javascript:;" data-skin="orange" style="color:#ff6700!important;">
            <i class="layui-icon">&#xe658;</i> 橘子橙</a></dd>
          <dd><a href="javascript:;" data-skin="green" style="color:#00a65a!important;">
            <i class="layui-icon">&#xe658;</i> 原谅绿</a></dd>
          <dd><a href="javascript:;" data-skin="pink" style="color:#FA6086!important;">
            <i class="layui-icon">&#xe658;</i> 少女粉</a></dd>
          <dd><a href="javascript:;" data-skin="blue.1" style="color:#00c0ef!important;">
            <i class="layui-icon">&#xe658;</i> 天空蓝</a></dd>
          <dd><a href="javascript:;" data-skin="red" style="color:#dd4b39!important;">
            <i class="layui-icon">&#xe658;</i> 枫叶红</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item">
        <a href="javascript:;">
          <input type="hidden" id="userId" th:value="${user.id}" value="">
          <i class="layui-icon layui-icon-username"><span th:text="${' ' + user.realName}">用户</span></i>
        </a>
        <dl class="layui-nav-child">
          <dd><a href="javascript:;" id="detailUser" >
            <i class="layui-icon layui-icon-form"></i><span>基本资料</span></a></dd>
          <hr>
          <dd><a href="javascript:;" id="changePassword">
            <i class="layui-icon layui-icon-password"></i><span>修改密码</span></a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="/webs/logout"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
    </ul>
  </div>

  <div class="layui-side layui-bg-black kit-side">
    <div class="layui-side-scroll">
      <div class="kit-side-fold"><i class="fa fa-navicon" aria-hidden="true"></i></div>
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree " lay-filter="kitNavbar" kit-navbar>
        <li class="layui-nav-item" th:each="menu:${menuList}">
          <a class="" href="javascript:;">
            <i class="layui-icon" aria-hidden="true" th:utext="${menu.getIcon()}"></i><span th:text="' '+${menu.getName()}"></span>
          </a>
          <dl class="layui-nav-child" th:if=" ${menu.getChildCount() > 0}">
            <dd th:each="menuChild : ${menu.getChildren()}">
              <!--<a href="javascript:;" kit-target data-options="{url:'/user/userList',icon:'&#xe6c6;',title:'表格',id:'1'}">-->
              <a href="javascript:;" kit-target th:attr="data-options='{url:\''+${menuChild.getUrl()}+'\',icon:\''+${menuChild.getIcon()}+'\',title:\''+${menuChild.getName()}+'\',id:\''+${menuChild.getOrderNum()}+'\'}'">
                <i class="layui-icon" th:utext="${menuChild.getIcon()}"></i><span th:text="' '+${menuChild.getName()}"></span></a>
            </dd>
          </dl>
        </li>
      </ul>
    </div>
  </div>
  <div class="layui-body" id="container">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;"><i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63e;</i> 请稍等...</div>
  </div>

  <div class="layui-footer">
    <!-- 底部固定区域 -->
    2018 &copy; 主场篮球
  </div>
</div>

<script>
    var message;

    layui.config({
        //base: '../../static/web/kitadmin/js/',
        base: '/web/kitadmin/js/',
        version: '1.0.1'
    }).use(['app', 'message'], function() {
        var app = layui.app,
            $ = layui.jquery,
            layer = layui.layer;
        //将message设置为全局以便子页面调用
        message = layui.message;

        //主入口
        app.set({
            type: 'iframe'
        }).init();

        //换皮肤
        $('dl.skin > dd').on('click', function() {
            var $that = $(this);
            var skin = $that.children('a').data('skin');
            switchSkin(skin);
        });

        var setSkin = function(value) {
                layui.data('kit_skin', {
                    key: 'skin',
                    value: value
                });
            },
            getSkinName = function() {
                return layui.data('kit_skin').skin;
            },
            switchSkin = function(value) {
                var _target = $('link[kit-skin]')[0];
                _target.href = _target.href.substring(0, _target.href.lastIndexOf('/') + 1) + value + _target.href.substring(_target.href.lastIndexOf('.'));
                setSkin(value);

            },
            initSkin = function() {
                var skin = getSkinName();
                switchSkin(skin === undefined ? 'default' : skin);
            }();

        $('#detailUser').on("click", function (e) {
            openWindow("detail-user","用户信息",'/webs/user/detailUser?id=' + $('#userId').val(),'50%' ,'60%')
        });

        $('#changePassword').on("click", function (e) {
            openWindow('user-changePwd', "修改密码", '/webs/user/changePassword?id=' + $('#userId').val(),'40%','50%');
        });

    });
</script>
</body>

</html>